<template>
    <div>
        <van-nav-bar
            title="详情页"
            left-text="返回"
            left-arrow
            @click-left="onClickLeft"
            />
            <img :src="obj.img" alt="">
            <h4>{{ obj.title }}</h4>
            <p>价格：{{ obj.price }}</p>
            <p>销量：{{ obj.num }}</p>
    </div>
</template>


<script setup>

import { reactive } from 'vue';
import { useRoute } from 'vue-router'

const route = useRoute()

const onClickLeft = () => history.back();

const obj = reactive({
    title: route.query.title,
    img: route.query.img,
    price:route.query.price,
    num: route.query.num
})

</script>

<style scoped>
    img{
        width: 100%;
    }
</style>